<template>
  <!-- 分享引导 -->
  <uv-popup ref="sharePopupGuideScene" zIndex="10999" :safeAreaInsetBottom="false" :closeOnClickOverlay="false" bgColor="none" @touchmove.stop.prevent="">
    <!-- 参与活动 -->
    <view class="guide-footer" :style="{ paddingBottom: `${buttomSafeArea}px` }">
      <uv-button size="large" shape="circle" color="#fb6338" @click="joinActivity" text="参与活动" />
    </view>
  </uv-popup>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'cuShareGuideScene',
  components: {},
  mixins: [],
  props: {
    shareInfo: {
      type: Object,
      default: () => {
        return {}
      },
    },
  },
  data() {
    return {}
  },
  watch: {
    appLaunchScene: {
      immediate: true,
      handler(nv) {
        this.$nextTick(() => {
          if ([1154].includes(nv)) this.openShareGuide()
        })
      },
    },
  },
  // 计算属性
  computed: {
    ...mapGetters(['appLaunchScene']),

    buttomSafeArea() {
      return this.$Platform.device.safeAreaInsets.bottom || 10
    },
  },

  created() {},
  mounted() {},
  destroyed() {},
  options: {},
  methods: {
    // open-share-guide
    openShareGuide() {
      this.$refs.sharePopupGuideScene.open()
    },

    // close-share-guide
    closeShareGuide() {
      this.$refs.sharePopupGuideScene.close()
    },

    joinActivity() {
      this.$uv.toast('请点击下方“前往小程序”参与活动')
    },
  },
}
</script>

<style lang="scss" scoped>
.guide-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  padding: 20rpx 30rpx;
  z-index: 99;
}
</style>
